<%-------------------------------------------------------------------
 * 页面名称：auditSteps.jsp
 * 功能描述：设置审核步骤
 * Action  : 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ipb" uri="/WEB-INF/conf/tld/ipb.tld"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
	String path = request.getContextPath();
%>
<script languange="javascript" type="text/javascript">
	function submitProcess(){
		var size = <bean:write name="size"/>;
		var typeId = <bean:write name="typeId"/>;

		document.getElementById('size').value = size;
		document.getElementById('transactionTypeId').value = typeId;
		document.AuditRuleForm.submit();
	}
	
	function checkStep(objCheckBox) {
		var bolCheck = objCheckBox.checked;
		// 获取选中行元素
		var strCheckName = objCheckBox.name;
		var arrCheck = document.getElementsByName(strCheckName);
		var intIndex = 0;
		for(var i =  0; i < arrCheck.length; i++) {
			if(objCheckBox.value == arrCheck[i].value) {
				intIndex = i;
			}
		}
		
		// 同一个用户其他checkbox设置为无效
		for(var i = 0; i < 6; i++) {
			var strListName = "auditGroupBeanList" + i;
			if(strListName != strCheckName) {
				if(document.getElementsByName(strListName).length > 0) {
					document.getElementsByName(strListName)[intIndex].disabled = bolCheck;
				}
			}
		}
	}
	
	function initStep() {
		for(var i = 0; i < 6; i++) {
			var strListName = "auditGroupBeanList" + i;
			for(var j = 0; j < document.getElementsByName(strListName).length; j++) {
				if(document.getElementsByName(strListName)[j].checked) {
					checkStep(document.getElementsByName(strListName)[j]);
				}
			}
		}
	}
	
</script>
<div id="main">
	<div class="content_right">
		<div style="width:745px;margin-left:10px;">
			<div class="titleinfo">
				设置
				<bean:write name="typeName" />
				审核步骤
			</div>
			<div class="edit_pass">
				<html:form action="/saveOrUpdateAuditRule.do">
					<input type="hidden" name="size" id="size"/>
					<html:hidden property="transactionTypeId"  styleId="transactionTypeId"/>
					<table width="100%" border="0" align="center" cellpadding="0"
						cellspacing="0">
						<tr>
							<td valign="top">
								<table width="100%" class="tablestyle">
									<tr>
										<th>
											<span class="blue14">审核员</span>
										</th>
									</tr>
									<logic:iterate id="operId" name="auditOperList" indexId="i">
										<tr>
											<td>
												<bean:write name="operId" property="operatorName" />
											</td>
										</tr>
									</logic:iterate>
								</table>
							</td>
							<logic:iterate id="stepId" name="auditStepList" indexId="ind">
								<td valign="top">
									<logic:equal name="ind" value="0">
										<table width="100%" class="tablestyle">
											<tr>
												<th>
													<bean:write name="stepId" property="name" />
												</th>
											</tr>
											<logic:iterate id="checkId" name="stepId"
												property="auditGroupBean" indexId="i0">
												<tr
													class="<%=i0.intValue()%2==0?"tableWhiteBg":"tableBlueBg"%>">
													<td>
														<html:multibox name="AuditRuleForm"
															property="auditGroupBeanList0"  styleClass="noinputline" onclick="checkStep(this);">
															<bean:write name="checkId" property="oper.id" />
														</html:multibox>
													</td>
												</tr>
											</logic:iterate>
										</table>
									</logic:equal>

									<logic:equal name="ind" value="1">
										<table width="100%" class="tablestyle">
											<tr>
												<th>
													<bean:write name="stepId" property="name" />
												</th>
											</tr>
											<logic:iterate id="checkId" name="stepId"
												property="auditGroupBean" indexId="i1">
												<tr
													class="<%=i1.intValue()%2==0?"tableWhiteBg":"tableBlueBg"%>">
													<td>
														<html:multibox name="AuditRuleForm"
															property="auditGroupBeanList1" styleClass="noinputline"  onclick="checkStep(this);">
															<bean:write name="checkId" property="oper.id" />
														</html:multibox>
													</td>
												</tr>
											</logic:iterate>
										</table>
									</logic:equal>

									<logic:equal name="ind" value="2">
										<table width="100%" class="tablestyle">
											<tr>
												<th>
													<bean:write name="stepId" property="name" />
												</th>
											</tr>
											<logic:iterate id="checkId" name="stepId"
												property="auditGroupBean" indexId="i2">
												<tr
													class="<%=i2.intValue()%2==0?"tableWhiteBg":"tableBlueBg"%>">
													<td>
														<html:multibox name="AuditRuleForm"
															property="auditGroupBeanList2" styleClass="noinputline"  onclick="checkStep(this);">
															<bean:write name="checkId" property="oper.id" />
														</html:multibox>
													</td>
												</tr>
											</logic:iterate>
										</table>
									</logic:equal>

									<logic:equal name="ind" value="3">
										<table width="100%" class="tablestyle">
											<tr>
												<th>
													<bean:write name="stepId" property="name" />
												</th>
											</tr>
											<logic:iterate id="checkId" name="stepId"
												property="auditGroupBean" indexId="i3">
												<tr
													class="<%=i3.intValue()%2==0?"tableWhiteBg":"tableBlueBg"%>">
													<td>
														<html:multibox name="AuditRuleForm"
															property="auditGroupBeanList3" styleClass="noinputline"  onclick="checkStep(this);">
															<bean:write name="checkId" property="oper.id" />
														</html:multibox>
													</td>
												</tr>
											</logic:iterate>
										</table>
									</logic:equal>

									<logic:equal name="ind" value="4">
										<table width="100%" class="tablestyle">
											<tr>
												<th>
													<bean:write name="stepId" property="name" />
												</th>
											</tr>
											<logic:iterate id="checkId" name="stepId"
												property="auditGroupBean" indexId="i4">
												<tr
													class="<%=i4.intValue()%2==0?"tableWhiteBg":"tableBlueBg"%>">
													<td>
														<html:multibox name="AuditRuleForm"
															property="auditGroupBeanList4" styleClass="noinputline"  onclick="checkStep(this);">
															<bean:write name="checkId" property="oper.id" />
														</html:multibox>
													</td>
												</tr>
											</logic:iterate>
										</table>
									</logic:equal>

									<logic:equal name="ind" value="5">
										<table width="100%" class="tablestyle">
											<tr>
												<th>
													<bean:write name="stepId" property="name" />
												</th>
											</tr>
											<logic:iterate id="checkId" name="stepId"
												property="auditGroupBean" indexId="i5">
												<tr
													class="<%=i5.intValue()%2==0?"tableWhiteBg":"tableBlueBg"%>">
													<td>
														<html:multibox name="AuditRuleForm"
															property="auditGroupBeanList5" styleClass="noinputline"  onclick="checkStep(this);">
															<bean:write name="checkId" property="oper.id" />
														</html:multibox>
													</td>
												</tr>
											</logic:iterate>
										</table>
									</logic:equal>
								</td>
							</logic:iterate>
						</tr>
					</table>
					<table width="100%" border="0" align="center" cellpadding="5"
						cellspacing="1">
						<tr>
							<td height="55" align="center">
								<span class="font_blue"> <input name="save" type="button"
										class="button_style" onclick="submitProcess();" value="保存设置" />
										<input name="return" type="button" class="button_style"
									onclick="javascript:history.back();"
									value="返 回" />
								</span>
								
							</td>
						</tr>
					</table>
				</html:form>
			</div>
		</div>
	</div>
</div>
<script languange="javascript" type="text/javascript">
	initStep();
</script>